include $(TOPDIR)/rules.mk
PKG_NAME:=gnunet
-PKG_SOURCE_VERSION:=d80214febe4e0e4cc64dddc74e990b3c5ca8a5df
-PKG_MIRROR_HASH:=12d6f8e8c9e17217db16fbb89d023f50dcf54b8ec1959c4a248880be9b11ef3c
-PKG_VERSION:=0.10.2-git-20190128-$(PKG_SOURCE_VERSION)
-PKG_RELEASE:=2
-
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
-PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
-PKG_SOURCE_URL:=https://gnunet.org/git/gnunet.git
-PKG_SOURCE_PROTO:=git
+PKG_VERSION:=0.11.0
+PKG_RELEASE:=1
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
+PKG_SOURCE_URL:=@GNU/gnunet
+PKG_HASH:=b7477a3c3b0d5e8a013685dc208cfb4ccee4145f8668faa8eb5b382af36c7e9a
PKG_LICENSE:=AGPL-3.0
PKG_LICENSE_FILES:=COPYING
define Package/gnunet
$(call Package/gnunet/Default)
TITLE+= - a peer-to-peer framework focusing on security
- DEPENDS:=+libgcrypt +libgpg-error +libidn2 +libltdl +libunistring +librt +zlib \
- $(ICONV_DEPENDS) $(INTL_DEPENDS)
+ DEPENDS:=+libatomic +libgcrypt +libgpg-error +libidn2 +libltdl +libunistring \
+ +librt +zlib $(ICONV_DEPENDS) $(INTL_DEPENDS)
USERID:=gnunet=958:gnunet=958
MENU:=1
endef
$(INSTALL_DIR) $(1)/usr/bin $(1)/usr/lib/gnunet/libexec
$(INSTALL_DIR) $(1)/usr/share/gnunet/config.d $(1)/usr/share/gnunet/hellos
- ( for bin in arm ats cadet core config ecc identity nat nat-auto nat-server nse \
+ ( for bin in arm ats ats-new cadet core config ecc identity nat nat-auto nat-server nse \
peerinfo revocation scalarproduct scrypt statistics transport uri; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/gnunet-$$$$bin $(1)/usr/bin/ ; \
done )
- ( for lib in arm ats block blockgroup cadet core datacache dht \
- dns dnsparser fragmentation friends hello identity natauto natnew nse \
- nt peerinfo regexblock regex revocation scalarproduct set \
- statistics transport util; do \
+ ( for lib in arm ats atsapplication atstransport block blockgroup cadet \
+ core datacache dht dns dnsparser fragmentation friends hello \
+ identity natauto natnew nse nt peerinfo regexblock regex revocation \
+ scalarproduct set statistics transport transportaddress \
+ transportcommunicator transportcore transportmonitor util; do \
$(CP) $(PKG_INSTALL_DIR)/usr/lib/libgnunet$$$$lib.so* $(1)/usr/lib/ ; \
done )
service-revocation service-scalarproduct-alice \
service-scalarproduct-bob service-scalarproduct-ecc-alice \
service-scalarproduct-ecc-bob service-set service-statistics \
- service-transport; do \
+ service-transport timeout; do \
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/gnunet/libexec/gnunet-$$$$lex $(1)/usr/lib/gnunet/libexec ; \
done )
LIBEXEC_peerstore:=service-peerstore
CONF_peerstore:=peerstore
-DEPENDS_rest:=+gnunet-gns +gnunet-social +libmicrohttpd-ssl +jansson
+DEPENDS_auction:=+gnunet-reclaim
+BIN_auction:=auction-create auction-info auction-join
+LIBEXEC_auction:=service-auction
+CONF_auction:=auction
+
+DEPENDS_reclaim:=+gnunet-gns +gnunet-sqlite +libpbc +libgabe
+BIN_reclaim:=credential reclaim
+LIB_reclaim:=consensus credential abe reclaim reclaimattribute secretsharing
+LIBEXEC_reclaim:=service-consensus service-credential service-reclaim service-secretsharing
+CONF_reclaim:=consensus reclaim secretsharing
+PLUGIN_reclaim:=block_consensus gnsrecord_credential gnsrecord_reclaim reclaim_attribute_gnuid reclaim_sqlite
+
+DEPENDS_rest:=+gnunet-gns +gnunet-reclaim +libmicrohttpd-ssl +jansson
LIB_rest:=rest json
PLUGIN_rest:=rest_copying rest_gns rest_identity rest_namestore rest_peerinfo rest_openid_connect rest_reclaim
LIBEXEC_rest:=rest-server
LIBEXEC_rps:=service-rps
CONF_rps:=rps
-DEPENDS_social:=+gnunet-gns +libmicrohttpd-ssl +jansson +libpbc +libgabe
-BIN_social:=credential identity-token multicast reclaim social
-LIB_social:=abe consensus credential identityprovider multicast psyc psycstore psycutil reclaim reclaimattribute secretsharing social
-LIBEXEC_social:=service-consensus service-credential service-evil-consensus service-identity-provider service-multicast service-psyc service-psycstore service-reclaim service-secretsharing service-social
-CONF_social:=consensus credential multicast psyc psycstore reclaim secretsharing social
-PLUGIN_social:=block_consensus gnsrecord_credential gnsrecord_reclaim reclaim_attribute_gnuid
-
PLUGIN_dhtcache-heap:=datacache_heap
CONFLICTS_dhtcache-heap:=gnunet-dhtcache-pgsql gnunet-dhtcache-sqlite
DEPENDS_mysql:=+libmysqlclient
LIB_mysql:=mysql my
-DEPENDS_social-mysql:=+gnunet-mysql +gnunet-social
-PLUGIN_social-mysql:=psycstore_mysql
-CONFLICTS_social-mysql:=gnunet-social-sqlite
DEPENDS_fs-mysql:=+gnunet-mysql +gnunet-datastore
PLUGIN_fs-mysql:=datastore_mysql
PLUGIN_gns-pgsql:=namecache_postgres namestore_postgres
CONFLICTS_gns-pgsql:=gnunet-gns-sqlite gnunet-gns-flat
-DEPENDS_social-pgsql:=+gnunet-pgsql +gnunet-social
-PLUGIN_social-pgsql:=psycstore_postgres
-CONFLICTS_social-pgsql:=gnunet-social-sqlite gnunet-social-mysql
DEPENDS_sqlite:=+libsqlite3
LIB_sqlite:=sq
DEPENDS_fs-sqlite:=+gnunet-datastore +gnunet-sqlite
PLUGIN_fs-sqlite:=datastore_sqlite
-DEPENDS_social-sqlite:=+gnunet-social +gnunet-sqlite
-PLUGIN_social-sqlite:=psycstore_sqlite reclaim_sqlite
DEPENDS_utils:=+certtool +openssl-util
$(eval $(call BuildComponent,gns-proxy,gns-proxy component,))
$(eval $(call BuildComponent,hostlist,HTTP bootstrap hostlist client and server,y))
$(eval $(call BuildComponent,peerstore,peerstore local persistency component,))
+$(eval $(call BuildComponent,reclaim,reclaim identity-provider subsystem,))
$(eval $(call BuildComponent,rest,REST interface,))
$(eval $(call BuildComponent,rps,RPS routing component,y))
-$(eval $(call BuildComponent,social,social components,))
$(eval $(call BuildComponent,namestore-fcfsd,first-come-first-serve registration server,))
$(eval $(call BuildComponent,dhtcache-heap,heap-based dhtcache plugin,y))
$(eval $(call BuildComponent,fs-heap,heap-based filesharing plugin,))
$(eval $(call BuildComponent,peerstore-flat,flat storage peerstore plugin,))
$(eval $(call BuildComponent,mysql,mySQL backend,))
$(eval $(call BuildComponent,fs-mysql,mySQL filesharing plugins,))
-$(eval $(call BuildComponent,social-mysql,mySQL social plugins,))
$(eval $(call BuildComponent,pgsql,PostgreSQL backend,))
$(eval $(call BuildComponent,dhtcache-pgsql,PostgreSQL dhtcache plugin,))
$(eval $(call BuildComponent,fs-pgsql,PostgreSQL filesharing plugin,))
$(eval $(call BuildComponent,gns-pgsql,PostgreSQL GNS plugins,))
-$(eval $(call BuildComponent,social-pgsql,PostgreSQL social plugin,))
$(eval $(call BuildComponent,sqlite,libsqlite3 backend,))
$(eval $(call BuildComponent,dhtcache-sqlite,libsqlite3 dhtcache plugin,))
$(eval $(call BuildComponent,fs-sqlite,libsqlite3 filesharing plugin,))
$(eval $(call BuildComponent,gns-sqlite,libsqlite3 gns plugins,))
$(eval $(call BuildComponent,peerstore-sqlite,libsqlite3 peerstore plugin,))
-$(eval $(call BuildComponent,social-sqlite,libsqlite3 social plugins,))
$(eval $(call BuildComponent,transport-bluetooth,bluetooth transport,))
$(eval $(call BuildComponent,transport-http_client,HTTP/HTTPS client transport,y))
$(eval $(call BuildComponent,transport-http_server,HTTP/HTTPS server transport,))
--- /dev/null
+From 6603f7e1a837d3a51a1949a6f4e1802b6ef3d806 Mon Sep 17 00:00:00 2001
+Date: Thu, 28 Feb 2019 14:19:34 +0100
+Subject: [PATCH] fix dist for experimental
+
+---
+ po/POTFILES.in | 114 ++++++++++++++++++++--------------------
+ src/include/Makefile.am | 1 +
+ 2 files changed, 58 insertions(+), 57 deletions(-)
+
+--- a/po/POTFILES.in
++++ b/po/POTFILES.in
+@@ -4,6 +4,14 @@ src/arm/arm_monitor_api.c
+ src/arm/gnunet-arm.c
+ src/arm/gnunet-service-arm.c
+ src/arm/mockup-service.c
++src/ats-tests/ats-testing-experiment.c
++src/ats-tests/ats-testing-log.c
++src/ats-tests/ats-testing-preferences.c
++src/ats-tests/ats-testing-traffic.c
++src/ats-tests/ats-testing.c
++src/ats-tests/gnunet-ats-sim.c
++src/ats-tests/gnunet-solver-eval.c
++src/ats-tool/gnunet-ats.c
+ src/ats/ats_api2_application.c
+ src/ats/ats_api2_transport.c
+ src/ats/ats_api_connectivity.c
+@@ -11,10 +19,10 @@ src/ats/ats_api_performance.c
+ src/ats/ats_api_scanner.c
+ src/ats/ats_api_scheduling.c
+ src/ats/gnunet-ats-solver-eval.c
+-src/ats/gnunet-service-ats_addresses.c
++src/ats/gnunet-service-ats-new.c
+ src/ats/gnunet-service-ats.c
++src/ats/gnunet-service-ats_addresses.c
+ src/ats/gnunet-service-ats_connectivity.c
+-src/ats/gnunet-service-ats-new.c
+ src/ats/gnunet-service-ats_normalization.c
+ src/ats/gnunet-service-ats_performance.c
+ src/ats/gnunet-service-ats_plugins.c
+@@ -26,14 +34,6 @@ src/ats/plugin_ats2_simple.c
+ src/ats/plugin_ats_mlp.c
+ src/ats/plugin_ats_proportional.c
+ src/ats/plugin_ats_ril.c
+-src/ats-tests/ats-testing.c
+-src/ats-tests/ats-testing-experiment.c
+-src/ats-tests/ats-testing-log.c
+-src/ats-tests/ats-testing-preferences.c
+-src/ats-tests/ats-testing-traffic.c
+-src/ats-tests/gnunet-ats-sim.c
+-src/ats-tests/gnunet-solver-eval.c
+-src/ats-tool/gnunet-ats.c
+ src/auction/gnunet-auction-create.c
+ src/auction/gnunet-auction-info.c
+ src/auction/gnunet-auction-join.c
+@@ -50,8 +50,8 @@ src/cadet/cadet_api_list_peers.c
+ src/cadet/cadet_api_list_tunnels.c
+ src/cadet/cadet_test_lib.c
+ src/cadet/desirability_table.c
+-src/cadet/gnunet-cadet.c
+ src/cadet/gnunet-cadet-profiler.c
++src/cadet/gnunet-cadet.c
+ src/cadet/gnunet-service-cadet.c
+ src/cadet/gnunet-service-cadet_channel.c
+ src/cadet/gnunet-service-cadet_connection.c
+@@ -67,15 +67,15 @@ src/consensus/gnunet-service-consensus.c
+ src/consensus/plugin_block_consensus.c
+ src/conversation/conversation_api.c
+ src/conversation/conversation_api_call.c
+-src/conversation/gnunet-conversation.c
+ src/conversation/gnunet-conversation-test.c
+-src/conversation/gnunet_gst.c
+-src/conversation/gnunet_gst_test.c
+-src/conversation/gnunet-helper-audio-playback.c
++src/conversation/gnunet-conversation.c
+ src/conversation/gnunet-helper-audio-playback-gst.c
+-src/conversation/gnunet-helper-audio-record.c
++src/conversation/gnunet-helper-audio-playback.c
+ src/conversation/gnunet-helper-audio-record-gst.c
++src/conversation/gnunet-helper-audio-record.c
+ src/conversation/gnunet-service-conversation.c
++src/conversation/gnunet_gst.c
++src/conversation/gnunet_gst_test.c
+ src/conversation/microphone.c
+ src/conversation/plugin_gnsrecord_conversation.c
+ src/conversation/speaker.c
+@@ -111,7 +111,6 @@ src/dht/dht_api.c
+ src/dht/dht_test_lib.c
+ src/dht/gnunet-dht-get.c
+ src/dht/gnunet-dht-monitor.c
+-src/dht/gnunet_dht_profiler.c
+ src/dht/gnunet-dht-put.c
+ src/dht/gnunet-service-dht.c
+ src/dht/gnunet-service-dht_clients.c
+@@ -120,6 +119,7 @@ src/dht/gnunet-service-dht_hello.c
+ src/dht/gnunet-service-dht_neighbours.c
+ src/dht/gnunet-service-dht_nse.c
+ src/dht/gnunet-service-dht_routing.c
++src/dht/gnunet_dht_profiler.c
+ src/dht/plugin_block_dht.c
+ src/dns/dns_api.c
+ src/dns/gnunet-dns-monitor.c
+@@ -129,8 +129,8 @@ src/dns/gnunet-service-dns.c
+ src/dns/gnunet-zonewalk.c
+ src/dns/plugin_block_dns.c
+ src/exit/gnunet-daemon-exit.c
+-src/exit/gnunet-helper-exit.c
+ src/exit/gnunet-helper-exit-windows.c
++src/exit/gnunet-helper-exit.c
+ src/fragmentation/defragmentation.c
+ src/fragmentation/fragmentation.c
+ src/fs/fs_api.c
+@@ -155,8 +155,8 @@ src/fs/gnunet-auto-share.c
+ src/fs/gnunet-daemon-fsprofiler.c
+ src/fs/gnunet-directory.c
+ src/fs/gnunet-download.c
+-src/fs/gnunet-fs.c
+ src/fs/gnunet-fs-profiler.c
++src/fs/gnunet-fs.c
+ src/fs/gnunet-helper-fs-publish.c
+ src/fs/gnunet-publish.c
+ src/fs/gnunet-search.c
+@@ -176,10 +176,10 @@ src/gns/gns_tld_api.c
+ src/gns/gnunet-bcd.c
+ src/gns/gnunet-dns2gns.c
+ src/gns/gnunet-gns-benchmark.c
+-src/gns/gnunet-gns.c
+ src/gns/gnunet-gns-helper-service-w32.c
+ src/gns/gnunet-gns-import.c
+ src/gns/gnunet-gns-proxy.c
++src/gns/gnunet-gns.c
+ src/gns/gnunet-service-gns.c
+ src/gns/gnunet-service-gns_interceptor.c
+ src/gns/gnunet-service-gns_resolver.c
+@@ -187,19 +187,19 @@ src/gns/nss/nss_gns.c
+ src/gns/nss/nss_gns_query.c
+ src/gns/plugin_block_gns.c
+ src/gns/plugin_gnsrecord_gns.c
++src/gns/w32nsp-install.c
++src/gns/w32nsp-resolve.c
++src/gns/w32nsp-uninstall.c
++src/gns/w32nsp.c
+ src/gnsrecord/gnsrecord.c
+ src/gnsrecord/gnsrecord_crypto.c
+ src/gnsrecord/gnsrecord_misc.c
+ src/gnsrecord/gnsrecord_serialization.c
+ src/gnsrecord/plugin_gnsrecord_dns.c
+-src/gns/w32nsp.c
+-src/gns/w32nsp-install.c
+-src/gns/w32nsp-resolve.c
+-src/gns/w32nsp-uninstall.c
+ src/hello/address.c
+ src/hello/gnunet-hello.c
+-src/hello/hello.c
+ src/hello/hello-ng.c
++src/hello/hello.c
+ src/hostlist/gnunet-daemon-hostlist.c
+ src/hostlist/gnunet-daemon-hostlist_client.c
+ src/hostlist/gnunet-daemon-hostlist_server.c
+@@ -222,8 +222,8 @@ src/namecache/namecache_api.c
+ src/namecache/plugin_namecache_flat.c
+ src/namecache/plugin_namecache_postgres.c
+ src/namecache/plugin_namecache_sqlite.c
+-src/namestore/gnunet-namestore.c
+ src/namestore/gnunet-namestore-fcfsd.c
++src/namestore/gnunet-namestore.c
+ src/namestore/gnunet-service-namestore.c
+ src/namestore/gnunet-zoneimport.c
+ src/namestore/namestore_api.c
+@@ -238,10 +238,10 @@ src/nat-auto/gnunet-service-nat-auto.c
+ src/nat-auto/gnunet-service-nat-auto_legacy.c
+ src/nat-auto/nat_auto_api.c
+ src/nat-auto/nat_auto_api_test.c
+-src/nat/gnunet-helper-nat-client.c
+ src/nat/gnunet-helper-nat-client-windows.c
+-src/nat/gnunet-helper-nat-server.c
++src/nat/gnunet-helper-nat-client.c
+ src/nat/gnunet-helper-nat-server-windows.c
++src/nat/gnunet-helper-nat-server.c
+ src/nat/gnunet-nat.c
+ src/nat/gnunet-service-nat.c
+ src/nat/gnunet-service-nat_externalip.c
+@@ -250,16 +250,16 @@ src/nat/gnunet-service-nat_mini.c
+ src/nat/gnunet-service-nat_stun.c
+ src/nat/nat_api.c
+ src/nat/nat_api_stun.c
+-src/nse/gnunet-nse.c
+ src/nse/gnunet-nse-profiler.c
++src/nse/gnunet-nse.c
+ src/nse/gnunet-service-nse.c
+ src/nse/nse_api.c
+ src/nt/nt.c
++src/peerinfo-tool/gnunet-peerinfo.c
++src/peerinfo-tool/gnunet-peerinfo_plugins.c
+ src/peerinfo/gnunet-service-peerinfo.c
+ src/peerinfo/peerinfo_api.c
+ src/peerinfo/peerinfo_api_notify.c
+-src/peerinfo-tool/gnunet-peerinfo.c
+-src/peerinfo-tool/gnunet-peerinfo_plugins.c
+ src/peerstore/gnunet-peerstore.c
+ src/peerstore/gnunet-service-peerstore.c
+ src/peerstore/peerstore_api.c
+@@ -295,7 +295,6 @@ src/regex/regex_internal_dht.c
+ src/regex/regex_test_graph.c
+ src/regex/regex_test_lib.c
+ src/regex/regex_test_random.c
+-src/rest/gnunet-rest-server.c
+ src/rest-plugins/json_reclaim.c
+ src/rest-plugins/oidc_helper.c
+ src/rest-plugins/plugin_rest_copying.c
+@@ -306,27 +305,28 @@ src/rest-plugins/plugin_rest_namestore.c
+ src/rest-plugins/plugin_rest_openid_connect.c
+ src/rest-plugins/plugin_rest_peerinfo.c
+ src/rest-plugins/plugin_rest_reclaim.c
++src/rest/gnunet-rest-server.c
+ src/rest/rest.c
+ src/revocation/gnunet-revocation.c
+ src/revocation/gnunet-service-revocation.c
+ src/revocation/plugin_block_revocation.c
+ src/revocation/revocation_api.c
+-src/rps/gnunet-rps.c
+ src/rps/gnunet-rps-profiler.c
++src/rps/gnunet-rps.c
+ src/rps/gnunet-service-rps.c
+ src/rps/gnunet-service-rps_custommap.c
+ src/rps/gnunet-service-rps_sampler.c
+ src/rps/gnunet-service-rps_sampler_elem.c
+ src/rps/gnunet-service-rps_view.c
+-src/rps/rps_api.c
+ src/rps/rps-sampler_client.c
+ src/rps/rps-sampler_common.c
+ src/rps/rps-test_util.c
++src/rps/rps_api.c
+ src/scalarproduct/gnunet-scalarproduct.c
+-src/scalarproduct/gnunet-service-scalarproduct_alice.c
+-src/scalarproduct/gnunet-service-scalarproduct_bob.c
+ src/scalarproduct/gnunet-service-scalarproduct-ecc_alice.c
+ src/scalarproduct/gnunet-service-scalarproduct-ecc_bob.c
++src/scalarproduct/gnunet-service-scalarproduct_alice.c
++src/scalarproduct/gnunet-service-scalarproduct_bob.c
+ src/scalarproduct/scalarproduct_api.c
+ src/secretsharing/gnunet-secretsharing-profiler.c
+ src/secretsharing/gnunet-service-secretsharing.c
+@@ -352,15 +352,16 @@ src/statistics/gnunet-statistics.c
+ src/statistics/statistics_api.c
+ src/template/gnunet-service-template.c
+ src/template/gnunet-template.c
++src/testbed-logger/gnunet-service-testbed-logger.c
++src/testbed-logger/testbed_logger_api.c
+ src/testbed/generate-underlay-topology.c
+ src/testbed/gnunet-daemon-latency-logger.c
+ src/testbed/gnunet-daemon-testbed-blacklist.c
+ src/testbed/gnunet-daemon-testbed-underlay.c
+ src/testbed/gnunet-helper-testbed.c
+-src/testbed/gnunet_mpi_test.c
+ src/testbed/gnunet-service-test-barriers.c
+-src/testbed/gnunet-service-testbed_barriers.c
+ src/testbed/gnunet-service-testbed.c
++src/testbed/gnunet-service-testbed_barriers.c
+ src/testbed/gnunet-service-testbed_cache.c
+ src/testbed/gnunet-service-testbed_connectionpool.c
+ src/testbed/gnunet-service-testbed_cpustatus.c
+@@ -368,20 +369,19 @@ src/testbed/gnunet-service-testbed_links
+ src/testbed/gnunet-service-testbed_meminfo.c
+ src/testbed/gnunet-service-testbed_oc.c
+ src/testbed/gnunet-service-testbed_peers.c
+-src/testbed/gnunet_testbed_mpi_spawn.c
+ src/testbed/gnunet-testbed-profiler.c
+-src/testbed-logger/gnunet-service-testbed-logger.c
+-src/testbed-logger/testbed_logger_api.c
+-src/testbed/testbed_api_barriers.c
++src/testbed/gnunet_mpi_test.c
++src/testbed/gnunet_testbed_mpi_spawn.c
+ src/testbed/testbed_api.c
++src/testbed/testbed_api_barriers.c
+ src/testbed/testbed_api_hosts.c
+ src/testbed/testbed_api_operations.c
+ src/testbed/testbed_api_peers.c
+ src/testbed/testbed_api_sd.c
+ src/testbed/testbed_api_services.c
+ src/testbed/testbed_api_statistics.c
+-src/testbed/testbed_api_testbed.c
+ src/testbed/testbed_api_test.c
++src/testbed/testbed_api_testbed.c
+ src/testbed/testbed_api_topology.c
+ src/testbed/testbed_api_underlay.c
+ src/testing/gnunet-testing.c
+@@ -393,29 +393,29 @@ src/transport/gnunet-communicator-tcp.c
+ src/transport/gnunet-communicator-udp.c
+ src/transport/gnunet-communicator-unix.c
+ src/transport/gnunet-helper-transport-bluetooth.c
+-src/transport/gnunet-helper-transport-wlan.c
+ src/transport/gnunet-helper-transport-wlan-dummy.c
++src/transport/gnunet-helper-transport-wlan.c
+ src/transport/gnunet-service-tng.c
+-src/transport/gnunet-service-transport_ats.c
+ src/transport/gnunet-service-transport.c
++src/transport/gnunet-service-transport_ats.c
+ src/transport/gnunet-service-transport_hello.c
+ src/transport/gnunet-service-transport_manipulation.c
+ src/transport/gnunet-service-transport_neighbours.c
+ src/transport/gnunet-service-transport_plugins.c
+ src/transport/gnunet-service-transport_validation.c
+-src/transport/gnunet-transport.c
+ src/transport/gnunet-transport-certificate-creation.c
+ src/transport/gnunet-transport-profiler.c
+ src/transport/gnunet-transport-wlan-receiver.c
+ src/transport/gnunet-transport-wlan-sender.c
++src/transport/gnunet-transport.c
+ src/transport/plugin_transport_http_client.c
+ src/transport/plugin_transport_http_common.c
+ src/transport/plugin_transport_http_server.c
+ src/transport/plugin_transport_smtp.c
+ src/transport/plugin_transport_tcp.c
+ src/transport/plugin_transport_template.c
+-src/transport/plugin_transport_udp_broadcasting.c
+ src/transport/plugin_transport_udp.c
++src/transport/plugin_transport_udp_broadcasting.c
+ src/transport/plugin_transport_unix.c
+ src/transport/plugin_transport_wlan.c
+ src/transport/plugin_transport_xt.c
+@@ -424,6 +424,11 @@ src/transport/tcp_connection_legacy.c
+ src/transport/tcp_server_legacy.c
+ src/transport/tcp_server_mst_legacy.c
+ src/transport/tcp_service_legacy.c
++src/transport/transport-testing-filenames.c
++src/transport/transport-testing-loggers.c
++src/transport/transport-testing-main.c
++src/transport/transport-testing-send.c
++src/transport/transport-testing.c
+ src/transport/transport_api2_address.c
+ src/transport/transport_api2_communication.c
+ src/transport/transport_api2_core.c
+@@ -436,11 +441,6 @@ src/transport/transport_api_manipulation
+ src/transport/transport_api_monitor_peers.c
+ src/transport/transport_api_monitor_plugins.c
+ src/transport/transport_api_offer_hello.c
+-src/transport/transport-testing.c
+-src/transport/transport-testing-filenames.c
+-src/transport/transport-testing-loggers.c
+-src/transport/transport-testing-main.c
+-src/transport/transport-testing-send.c
+ src/util/bandwidth.c
+ src/util/benchmark.c
+ src/util/bio.c
+@@ -453,8 +453,8 @@ src/util/configuration_loader.c
+ src/util/container_bloomfilter.c
+ src/util/container_heap.c
+ src/util/container_meta_data.c
+-src/util/container_multihashmap32.c
+ src/util/container_multihashmap.c
++src/util/container_multihashmap32.c
+ src/util/container_multipeermap.c
+ src/util/container_multishortmap.c
+ src/util/crypto_abe.c
+@@ -476,15 +476,15 @@ src/util/dnsparser.c
+ src/util/dnsstub.c
+ src/util/getopt.c
+ src/util/getopt_helpers.c
+-src/util/gnunet-config.c
+ src/util/gnunet-config-diff.c
++src/util/gnunet-config.c
+ src/util/gnunet-ecc.c
+ src/util/gnunet-helper-w32-console.c
+ src/util/gnunet-resolver.c
+ src/util/gnunet-scrypt.c
+ src/util/gnunet-service-resolver.c
+-src/util/gnunet-timeout.c
+ src/util/gnunet-timeout-w32.c
++src/util/gnunet-timeout.c
+ src/util/gnunet-uri.c
+ src/util/helper.c
+ src/util/load.c
+@@ -513,13 +513,13 @@ src/util/tun.c
+ src/util/w32cat.c
+ src/util/win.c
+ src/util/winproc.c
+-src/vpn/gnunet-helper-vpn.c
+ src/vpn/gnunet-helper-vpn-windows.c
++src/vpn/gnunet-helper-vpn.c
+ src/vpn/gnunet-service-vpn.c
+ src/vpn/gnunet-vpn.c
+ src/vpn/vpn_api.c
+-src/zonemaster/gnunet-service-zonemaster.c
+ src/zonemaster/gnunet-service-zonemaster-monitor.c
++src/zonemaster/gnunet-service-zonemaster.c
+ src/fs/fs_api.h
+ src/include/compat.h
+ src/include/gnunet_common.h
+--- a/src/include/Makefile.am
++++ b/src/include/Makefile.am
+@@ -47,6 +47,7 @@ gnunetinclude_HEADERS = \
+ gnunet_container_lib.h \
+ gnunet_conversation_service.h \
+ gnunet_core_service.h \
++ gnunet_credential_service.h \
+ gnunet_crypto_lib.h \
+ gnunet_curl_lib.h \
+ gnunet_datacache_lib.h \
+--- /dev/null
++++ b/src/include/gnunet_credential_service.h
+@@ -0,0 +1,375 @@
++/*
++ This file is part of GNUnet
++ Copyright (C) 2012-2014 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++ */
++
++/**
++ * @author Martin Schanzenbach
++ *
++ * @file
++ * API to the Credential service
++ *
++ * @defgroup credential Credential service
++ * Credentials
++ *
++ * @{
++ */
++#ifndef GNUNET_CREDENTIAL_SERVICE_H
++#define GNUNET_CREDENTIAL_SERVICE_H
++
++#include "gnunet_util_lib.h"
++#include "gnunet_gns_service.h"
++#include "gnunet_identity_service.h"
++
++#ifdef __cplusplus
++extern "C"
++{
++#if 0 /* keep Emacsens' auto-indent happy */
++}
++#endif
++#endif
++
++
++/**
++ * Connection to the Credential service.
++ */
++struct GNUNET_CREDENTIAL_Handle;
++
++/**
++ * Handle to control a lookup operation.
++ */
++struct GNUNET_CREDENTIAL_Request;
++
++/*
++* Enum used for checking whether the issuer has the authority to issue credentials or is just a subject
++*/
++enum GNUNET_CREDENTIAL_CredentialFlags {
++
++ //Subject had credentials before, but have been revoked now
++ GNUNET_CREDENTIAL_FLAG_REVOKED=0,
++
++ //Subject flag indicates that the subject is a holder of this credential and may present it as such
++ GNUNET_CREDENTIAL_FLAG_SUBJECT=1,
++
++ //Issuer flag is used to signify that the subject is allowed to issue this credential and delegate issuance
++ GNUNET_CREDENTIAL_FLAG_ISSUER=2
++
++};
++
++GNUNET_NETWORK_STRUCT_BEGIN
++/**
++ * The attribute delegation record
++ */
++struct GNUNET_CREDENTIAL_DelegationRecord {
++
++ /**
++ * Number of delegation sets in this record
++ */
++ uint32_t set_count;
++
++ /**
++ * Length of delegation sets
++ */
++ uint64_t data_size;
++ /**
++ * Followed by set_count DelegationSetRecords
++ *
++ */
++};
++
++/**
++ * The attribute delegation record
++ */
++struct GNUNET_CREDENTIAL_DelegationRecordSet {
++
++ /**
++ * Public key of the subject this attribute was delegated to
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Length of attribute, may be 0
++ */
++ uint32_t subject_attribute_len;
++};
++
++
++GNUNET_NETWORK_STRUCT_END
++
++/**
++ * The attribute delegation record
++ */
++struct GNUNET_CREDENTIAL_DelegationSet {
++
++ /**
++ * Public key of the subject this attribute was delegated to
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ uint32_t subject_attribute_len;
++
++ /**
++ * The subject attribute
++ */
++ const char *subject_attribute;
++};
++
++
++/**
++ * A delegation
++ */
++struct GNUNET_CREDENTIAL_Delegation {
++
++ /**
++ * The issuer of the delegation
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Public key of the subject this attribute was delegated to
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Length of the attribute
++ */
++ uint32_t issuer_attribute_len;
++
++ /**
++ * The attribute
++ */
++ const char *issuer_attribute;
++
++ /**
++ * Length of the attribute
++ */
++ uint32_t subject_attribute_len;
++
++ /**
++ * The attribute
++ */
++ const char *subject_attribute;
++};
++
++
++/**
++ * A credential
++ */
++struct GNUNET_CREDENTIAL_Credential {
++
++ /**
++ * The issuer of the credential
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Public key of the subject this credential was issued to
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Signature of this credential
++ */
++ struct GNUNET_CRYPTO_EcdsaSignature signature;
++
++ /**
++ * Expiration of this credential
++ */
++ struct GNUNET_TIME_Absolute expiration;
++
++ /**
++ * Length of the attribute
++ */
++ uint32_t issuer_attribute_len;
++
++ /**
++ * The attribute
++ */
++ const char *issuer_attribute;
++
++};
++
++
++
++/**
++ * Initialize the connection with the Credential service.
++ *
++ * @param cfg configuration to use
++ * @return handle to the Credential service, or NULL on error
++ */
++struct GNUNET_CREDENTIAL_Handle *
++GNUNET_CREDENTIAL_connect (const struct GNUNET_CONFIGURATION_Handle *cfg);
++
++
++/**
++ * Shutdown connection with the Credentail service.
++ *
++ * @param handle connection to shut down
++ */
++void
++GNUNET_CREDENTIAL_disconnect (struct GNUNET_CREDENTIAL_Handle *handle);
++
++
++/**
++ * Iterator called on obtained result for an attribute verification.
++ *
++ * @param cls closure
++ * @param d_count the number of delegations processed
++ * @param delegation_chain the delegations processed
++ * @param c_count the number of credentials found
++ * @param credential the credentials
++ */
++typedef void (*GNUNET_CREDENTIAL_CredentialResultProcessor) (void *cls,
++ unsigned int d_count,
++ struct GNUNET_CREDENTIAL_Delegation *delegation_chain,
++ unsigned int c_count,
++ struct GNUNET_CREDENTIAL_Credential *credential);
++
++/**
++ * Iterator called on obtained result for an attribute delegation.
++ *
++ * @param cls closure
++ * @param success GNUNET_YES if successful
++ * @param result the record data that can be handed to the subject
++ */
++typedef void (*GNUNET_CREDENTIAL_DelegateResultProcessor) (void *cls,
++ uint32_t success);
++
++/**
++ * Iterator called on obtained result for an attribute delegation removal.
++ *
++ * @param cls closure
++ * @param success GNUNET_YES if successful
++ * @param result the record data that can be handed to the subject
++ */
++typedef void (*GNUNET_CREDENTIAL_RemoveDelegateResultProcessor) (void *cls,
++ uint32_t success);
++
++
++/**
++ * Performs attribute verification.
++ * Checks if there is a delegation chain from
++ * attribute ``issuer_attribute'' issued by the issuer
++ * with public key ``issuer_key'' maps to the attribute
++ * ``subject_attribute'' claimed by the subject with key
++ * ``subject_key''
++ *
++ * @param handle handle to the Credential service
++ * @param issuer_key the issuer public key
++ * @param issuer_attribute the issuer attribute
++ * @param subject_key the subject public key
++ * @param credential_count number of credentials
++ * @param credentials the subject credentials
++ * @param proc function to call on result
++ * @param proc_cls closure for processor
++ * @return handle to the queued request
++ */
++struct GNUNET_CREDENTIAL_Request*
++GNUNET_CREDENTIAL_verify (struct GNUNET_CREDENTIAL_Handle *handle,
++ const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
++ const char *issuer_attribute,
++ const struct GNUNET_CRYPTO_EcdsaPublicKey *subject_key,
++ uint32_t credential_count,
++ const struct GNUNET_CREDENTIAL_Credential *credentials,
++ GNUNET_CREDENTIAL_CredentialResultProcessor proc,
++ void *proc_cls);
++
++struct GNUNET_CREDENTIAL_Request*
++GNUNET_CREDENTIAL_collect (struct GNUNET_CREDENTIAL_Handle *handle,
++ const struct GNUNET_CRYPTO_EcdsaPublicKey *issuer_key,
++ const char *issuer_attribute,
++ const struct GNUNET_CRYPTO_EcdsaPrivateKey *subject_key,
++ GNUNET_CREDENTIAL_CredentialResultProcessor proc,
++ void *proc_cls);
++
++/**
++ * Delegate an attribute
++ *
++ * @param handle handle to the Credential service
++ * @param issuer the ego that should be used to delegate the attribute
++ * @param attribute the name of the attribute to delegate
++ * @param subject the subject of the delegation
++ * @param delegated_attribute the name of the attribute that is delegated to
++ * @param proc the result callback
++ * @param proc_cls the result closure context
++ * @return handle to the queued request
++ */
++struct GNUNET_CREDENTIAL_Request *
++GNUNET_CREDENTIAL_add_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
++ struct GNUNET_IDENTITY_Ego *issuer,
++ const char *attribute,
++ struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
++ const char *delegated_attribute,
++ GNUNET_CREDENTIAL_DelegateResultProcessor proc,
++ void *proc_cls);
++
++/**
++ * Remove a delegation
++ *
++ * @param handle handle to the Credential service
++ * @param issuer the ego that was used to delegate the attribute
++ * @param attribute the name of the attribute that is delegated
++ * @param proc the callback
++ * @param proc_cls callback closure
++ * @return handle to the queued request
++ */
++struct GNUNET_CREDENTIAL_Request *
++GNUNET_CREDENTIAL_remove_delegation (struct GNUNET_CREDENTIAL_Handle *handle,
++ struct GNUNET_IDENTITY_Ego *issuer,
++ const char *attribute,
++ GNUNET_CREDENTIAL_RemoveDelegateResultProcessor proc,
++ void *proc_cls);
++
++
++
++/**
++ * Issue an attribute to a subject
++ *
++ * @param issuer the ego that should be used to issue the attribute
++ * @param subject the subject of the attribute
++ * @param attribute the name of the attribute
++ * @param expiration the TTL of the credential
++ * @return handle to the queued request
++ */
++struct GNUNET_CREDENTIAL_Credential*
++GNUNET_CREDENTIAL_credential_issue (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
++ struct GNUNET_CRYPTO_EcdsaPublicKey *subject,
++ const char *attribute,
++ struct GNUNET_TIME_Absolute *expiration);
++
++
++
++/**
++ * Cancel pending lookup request
++ *
++ * @param lr the lookup request to cancel
++ */
++void
++GNUNET_CREDENTIAL_request_cancel (struct GNUNET_CREDENTIAL_Request *lr);
++
++
++#if 0 /* keep Emacsens' auto-indent happy */
++{
++#endif
++#ifdef __cplusplus
++}
++#endif
++
++#endif
++
++/** @} */ /* end of group */
--- /dev/null
+From 5be7a51b0980909719670953c938ee724627ad90 Mon Sep 17 00:00:00 2001
+Date: Thu, 28 Feb 2019 15:30:26 +0100
+Subject: [PATCH] credential: include headers in dist sources
+
+---
+ src/credential/Makefile.am | 3 +++
+ src/include/Makefile.am | 4 ++--
+ 2 files changed, 5 insertions(+), 2 deletions(-)
+
+--- a/src/credential/Makefile.am
++++ b/src/credential/Makefile.am
+@@ -68,8 +68,11 @@ gnunet_service_credential_LDADD = \
+
+
+ libgnunetcredential_la_SOURCES = \
++ credential.h \
+ credential_api.c \
++ credential_serialization.h \
+ credential_serialization.c \
++ credential_misc.h \
+ credential_misc.c
+ libgnunetcredential_la_LIBADD = \
+ $(top_builddir)/src/util/libgnunetutil.la $(XLIB)
+--- a/src/include/Makefile.am
++++ b/src/include/Makefile.am
+@@ -47,7 +47,7 @@ gnunetinclude_HEADERS = \
+ gnunet_container_lib.h \
+ gnunet_conversation_service.h \
+ gnunet_core_service.h \
+- gnunet_credential_service.h \
++ gnunet_credential_service.h \
+ gnunet_crypto_lib.h \
+ gnunet_curl_lib.h \
+ gnunet_datacache_lib.h \
+@@ -107,7 +107,7 @@ gnunetinclude_HEADERS = \
+ gnunet_regex_service.h \
+ gnunet_rest_lib.h \
+ gnunet_rest_plugin.h \
+- gnunet_rps_service.h \
++ gnunet_rps_service.h \
+ gnunet_revocation_service.h \
+ gnunet_scalarproduct_service.h \
+ gnunet_scheduler_lib.h \
+--- /dev/null
++++ b/src/credential/credential.h
+@@ -0,0 +1,221 @@
++/*
++ This file is part of GNUnet
++ Copyright (C) 2012-2013 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++ */
++/**
++ * @file credential/credential.h
++ * @brief IPC messages between CREDENTIAL API and CREDENTIAL service
++ * @author Martin Schanzenbach
++ */
++#ifndef CREDENTIAL_H
++#define CREDENTIAL_H
++
++#include "gnunet_credential_service.h"
++
++GNUNET_NETWORK_STRUCT_BEGIN
++
++/**
++ * Message from client to Credential service to collect credentials.
++ */
++struct CollectMessage
++{
++ /**
++ * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
++ */
++ struct GNUNET_MessageHeader header;
++
++ /**
++ * Subject public key
++ */
++ struct GNUNET_CRYPTO_EcdsaPrivateKey subject_key;
++
++ /**
++ * Trust anchor
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Length of the issuer attribute
++ */
++ uint16_t issuer_attribute_len;
++
++ /**
++ * Unique identifier for this request (for key collisions).
++ */
++ uint32_t id GNUNET_PACKED;
++
++ /* Followed by the zero-terminated attribute */
++
++};
++
++
++/**
++ * Message from client to Credential service to verify attributes.
++ */
++struct VerifyMessage
++{
++ /**
++ * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY
++ */
++ struct GNUNET_MessageHeader header;
++
++ /**
++ * Subject public key
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Trust anchor
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Number of credentials
++ */
++ uint32_t c_count;
++
++ /**
++ * Length of the issuer attribute
++ */
++ uint16_t issuer_attribute_len;
++
++ /**
++ * Unique identifier for this request (for key collisions).
++ */
++ uint32_t id GNUNET_PACKED;
++
++ /* Followed by the zero-terminated attribute and credentials to look up */
++
++};
++
++
++/**
++ * Message from CREDENTIAL service to client: new results.
++ */
++struct DelegationChainResultMessage
++{
++ /**
++ * Header of type #GNUNET_MESSAGE_TYPE_CREDENTIAL_VERIFY_RESULT
++ */
++ struct GNUNET_MessageHeader header;
++
++ /**
++ * Unique identifier for this request (for key collisions).
++ */
++ uint32_t id GNUNET_PACKED;
++
++ /**
++ * Indicates if credential has been found at all
++ */
++ uint32_t cred_found GNUNET_PACKED;
++
++ /**
++ * The number of delegations in the response
++ */
++ uint32_t d_count GNUNET_PACKED;
++
++ /**
++ * The number of credentials in the response
++ */
++ uint32_t c_count GNUNET_PACKED;
++
++ /* followed by ad_count GNUNET_CREDENTIAL_RecordData structs*/
++
++};
++
++struct DelegationRecordData
++{
++ /**
++ * Subject key
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Subject attributes
++ */
++ uint32_t subject_attribute_len GNUNET_PACKED;
++};
++
++
++struct ChainEntry
++{
++ /**
++ * Issuer key
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Subject key
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Issuer attributes
++ */
++ uint32_t issuer_attribute_len GNUNET_PACKED;
++
++ /**
++ * Subject attributes
++ */
++ uint32_t subject_attribute_len GNUNET_PACKED;
++};
++
++
++struct CredentialEntry
++{
++
++ /**
++ * The signature for this credential by the issuer
++ */
++ struct GNUNET_CRYPTO_EcdsaSignature signature;
++
++ /**
++ * Signature meta
++ */
++ struct GNUNET_CRYPTO_EccSignaturePurpose purpose;
++
++ /**
++ * Public key of the issuer
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey issuer_key;
++
++ /**
++ * Public key of the subject this credential was issued to
++ */
++ struct GNUNET_CRYPTO_EcdsaPublicKey subject_key;
++
++ /**
++ * Expiration time of this credential
++ */
++ uint64_t expiration GNUNET_PACKED;
++
++ /**
++ * Issuer attribute length
++ */
++ uint32_t issuer_attribute_len;
++
++ /**
++ * Followed by the attribute string
++ */
++};
++
++
++GNUNET_NETWORK_STRUCT_END
++
++#endif
++
+--- /dev/null
++++ b/src/credential/credential_misc.h
+@@ -0,0 +1,35 @@
++/*
++ This file is part of GNUnet
++ Copyright (C) 2012-2013 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++ */
++/**
++ * @file credential/credential_misc.h
++ * @brief Credential helper functions
++ */
++#ifndef CREDENTIAL_MISC_H
++#define CREDENTIAL_MISC_H
++
++
++
++char*
++GNUNET_CREDENTIAL_credential_to_string (const struct GNUNET_CREDENTIAL_Credential *cred);
++
++struct GNUNET_CREDENTIAL_Credential*
++GNUNET_CREDENTIAL_credential_from_string (const char* str);
++
++#endif
+--- /dev/null
++++ b/src/credential/credential_serialization.h
+@@ -0,0 +1,159 @@
++/*
++ This file is part of GNUnet.
++ Copyright (C) 2009-2013, 2016 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++*/
++
++
++/**
++ * @file credential/credential_serialization.h
++ * @brief API to serialize and deserialize delegation chains
++ * and credentials
++ * @author Martin Schanzenbach
++ */
++#ifndef CREDENTIAL_SERIALIZATION_H
++#define CREDENTIAL_SERIALIZATION_H
++
++#include "platform.h"
++#include "gnunet_util_lib.h"
++#include "gnunet_constants.h"
++#include "gnunet_credential_service.h"
++
++/**
++ * Calculate how many bytes we will need to serialize
++ * the given delegation record
++ *
++ * @param ds_count number of delegation chain entries
++ * @param dsr array of #GNUNET_CREDENTIAL_Delegation
++ * @return the required size to serialize
++ */
++size_t
++GNUNET_CREDENTIAL_delegation_set_get_size (unsigned int ds_count,
++ const struct GNUNET_CREDENTIAL_DelegationSet *dsr);
++
++/**
++ * Serizalize the given delegation record entries
++ *
++ * @param d_count number of delegation chain entries
++ * @param dsr array of #GNUNET_CREDENTIAL_Delegation
++ * @param dest_size size of the destination
++ * @param dest where to store the result
++ * @return the size of the data, -1 on failure
++ */
++ssize_t
++GNUNET_CREDENTIAL_delegation_set_serialize (unsigned int d_count,
++ const struct GNUNET_CREDENTIAL_DelegationSet *dsr,
++ size_t dest_size,
++ char *dest);
++
++
++/**
++ * Deserialize the given destination
++ *
++ * @param len size of the serialized delegation recird
++ * @param src the serialized data
++ * @param d_count the number of delegation chain entries
++ * @param dsr where to put the delegation chain entries
++ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
++ */
++int
++GNUNET_CREDENTIAL_delegation_set_deserialize (size_t len,
++ const char *src,
++ unsigned int d_count,
++ struct GNUNET_CREDENTIAL_DelegationSet *dsr);
++
++ /**
++ * Calculate how many bytes we will need to serialize
++ * the given delegation chain and credential
++ *
++ * @param d_count number of delegation chain entries
++ * @param dd array of #GNUNET_CREDENTIAL_Delegation
++ * @param c_count number of credential entries
++ * @param cd a #GNUNET_CREDENTIAL_Credential
++ * @return the required size to serialize
++ */
++ size_t
++ GNUNET_CREDENTIAL_delegation_chain_get_size (unsigned int d_count,
++ const struct GNUNET_CREDENTIAL_Delegation *dd,
++ unsigned int c_count,
++ const struct GNUNET_CREDENTIAL_Credential *cd);
++
++ /**
++ * Serizalize the given delegation chain entries and credential
++ *
++ * @param d_count number of delegation chain entries
++ * @param dd array of #GNUNET_CREDENTIAL_Delegation
++ * @param c_count number of credential entries
++ * @param cd a #GNUNET_CREDENTIAL_Credential
++ * @param dest_size size of the destination
++ * @param dest where to store the result
++ * @return the size of the data, -1 on failure
++ */
++ ssize_t
++ GNUNET_CREDENTIAL_delegation_chain_serialize (unsigned int d_count,
++ const struct GNUNET_CREDENTIAL_Delegation *dd,
++ unsigned int c_count,
++ const struct GNUNET_CREDENTIAL_Credential *cd,
++ size_t dest_size,
++ char *dest);
++
++
++ /**
++ * Deserialize the given destination
++ *
++ * @param len size of the serialized delegation chain and cred
++ * @param src the serialized data
++ * @param d_count the number of delegation chain entries
++ * @param dd where to put the delegation chain entries
++ * @param c_count number of credential entries
++ * @param cd where to put the credential data
++ * @return #GNUNET_OK on success, #GNUNET_SYSERR on error
++ */
++ int
++ GNUNET_CREDENTIAL_delegation_chain_deserialize (size_t len,
++ const char *src,
++ unsigned int d_count,
++ struct GNUNET_CREDENTIAL_Delegation *dd,
++ unsigned int c_count,
++ struct GNUNET_CREDENTIAL_Credential *cd);
++ size_t
++ GNUNET_CREDENTIAL_credentials_get_size (unsigned int c_count,
++ const struct GNUNET_CREDENTIAL_Credential *cd);
++
++ssize_t
++GNUNET_CREDENTIAL_credentials_serialize (unsigned int c_count,
++ const struct GNUNET_CREDENTIAL_Credential *cd,
++ size_t dest_size,
++ char *dest);
++
++
++int
++GNUNET_CREDENTIAL_credentials_deserialize (size_t len,
++ const char *src,
++ unsigned int c_count,
++ struct GNUNET_CREDENTIAL_Credential *cd);
++
++
++int
++GNUNET_CREDENTIAL_credential_serialize (struct GNUNET_CREDENTIAL_Credential *cred,
++ char **data);
++
++struct GNUNET_CREDENTIAL_Credential*
++GNUNET_CREDENTIAL_credential_deserialize (const char* data,
++ size_t data_size);
++#endif
++/* end of credential_serialization.h */
+--- a/src/credential/Makefile.in
++++ b/src/credential/Makefile.in
+@@ -714,8 +714,11 @@ gnunet_service_credential_LDADD = \
+ $(GN_LIBINTL)
+
+ libgnunetcredential_la_SOURCES = \
++ credential.h \
+ credential_api.c \
++ credential_serialization.h \
+ credential_serialization.c \
++ credential_misc.h \
+ credential_misc.c
+
+ libgnunetcredential_la_LIBADD = \
--- /dev/null
+From c776664d488028f844ae6045e60f693a8624bfac Mon Sep 17 00:00:00 2001
+Date: Thu, 28 Feb 2019 16:06:06 +0100
+Subject: [PATCH] reclaim-attribute: include header in dist sources
+
+---
+ src/reclaim-attribute/Makefile.am | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/src/reclaim-attribute/Makefile.am
++++ b/src/reclaim-attribute/Makefile.am
+@@ -20,6 +20,7 @@ lib_LTLIBRARIES = \
+ libgnunetreclaimattribute.la
+
+ libgnunetreclaimattribute_la_SOURCES = \
++ reclaim_attribute.h \
+ reclaim_attribute.c
+ libgnunetreclaimattribute_la_LIBADD = \
+ $(top_builddir)/src/util/libgnunetutil.la \
+--- /dev/null
++++ b/src/reclaim-attribute/reclaim_attribute.h
+@@ -0,0 +1,56 @@
++/*
++ This file is part of GNUnet.
++ Copyright (C) 2012-2015 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++ */
++/**
++ * @author Martin Schanzenbach
++ * @file reclaim-attribute/reclaim_attribute.h
++ * @brief GNUnet reclaim identity attributes
++ *
++ */
++#ifndef RECLAIM_ATTRIBUTE_H
++#define RECLAIM_ATTRIBUTE_H
++
++#include "gnunet_reclaim_service.h"
++
++struct Attribute
++{
++ /**
++ * Attribute type
++ */
++ uint32_t attribute_type;
++
++ /**
++ * Attribute version
++ */
++ uint32_t attribute_version;
++
++ /**
++ * Name length
++ */
++ uint32_t name_len;
++
++ /**
++ * Data size
++ */
++ uint32_t data_size;
++
++ //followed by data_size Attribute value data
++};
++
++#endif
--- /dev/null
+From 6c0f43552d627b93f99f7fd40d63815f323958c3 Mon Sep 17 00:00:00 2001
+Date: Thu, 28 Feb 2019 16:16:13 +0100
+Subject: [PATCH] reclaim: include reclaim.conf in source dist
+
+---
+ src/reclaim/Makefile.am | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/src/reclaim/Makefile.am
++++ b/src/reclaim/Makefile.am
+@@ -17,9 +17,10 @@ SQLITE_PLUGIN = libgnunet_plugin_reclaim
+ endif
+
+ EXTRA_DIST = \
++ reclaim.conf \
+ test_reclaim_defaults.conf \
+- test_reclaim.conf \
+- $(check_SCRIPTS)
++ test_reclaim.conf \
++ $(check_SCRIPTS)
+
+ pkgcfgdir= $(pkgdatadir)/config.d/
+
+--- /dev/null
++++ b/src/reclaim/reclaim.conf
+@@ -0,0 +1,23 @@
++[reclaim]
++START_ON_DEMAND = NO
++RUN_PER_USER = YES
++#PORT = 2108
++HOSTNAME = localhost
++BINARY = gnunet-service-reclaim
++ACCEPT_FROM = 127.0.0.1;
++ACCEPT_FROM6 = ::1;
++UNIXPATH = $GNUNET_USER_RUNTIME_DIR/gnunet-service-reclaim.sock
++UNIX_MATCH_UID = NO
++UNIX_MATCH_GID = YES
++TOKEN_EXPIRATION_INTERVAL = 30 m
++DATABASE = sqlite
++
++[reclaim-rest-plugin]
++#ADDRESS = https://identity.gnu:8000#/login
++ADDRESS = https://ui.reclaim/#/login
++PSW = secret
++JWT_SECRET = secret
++EXPIRATION_TIME = 1d
++
++[reclaim-sqlite]
++FILENAME = $GNUNET_DATA_HOME/reclaim/sqlite.db
--- /dev/null
+From da16f9c20dda74dc689c9564d1791cc2af3ede9d Mon Sep 17 00:00:00 2001
+Date: Thu, 28 Feb 2019 16:23:40 +0100
+Subject: [PATCH] rest-plugins: include headers in dist sources
+
+---
+ src/rest-plugins/Makefile.am | 2 ++
+ 1 file changed, 2 insertions(+)
+
+--- a/src/rest-plugins/Makefile.am
++++ b/src/rest-plugins/Makefile.am
+@@ -30,6 +30,7 @@ endif
+
+ libgnunet_plugin_rest_reclaim_la_SOURCES = \
+ plugin_rest_reclaim.c \
++ json_reclaim.h \
+ json_reclaim.c
+ libgnunet_plugin_rest_reclaim_la_LIBADD = \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+@@ -117,6 +118,7 @@ libgnunet_plugin_rest_gns_la_LDFLAGS = \
+
+ libgnunet_plugin_rest_openid_connect_la_SOURCES = \
+ plugin_rest_openid_connect.c \
++ oidc_helper.h \
+ oidc_helper.c
+ libgnunet_plugin_rest_openid_connect_la_LIBADD = \
+ $(top_builddir)/src/identity/libgnunetidentity.la \
+--- /dev/null
++++ b/src/rest-plugins/oidc_helper.h
+@@ -0,0 +1,111 @@
++/*
++ This file is part of GNUnet
++ Copyright (C) 2010-2015 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++ */
++
++/**
++ * @file reclaim/oidc_helper.h
++ * @brief helper library for OIDC related functions
++ * @author Martin Schanzenbach
++ */
++
++#ifndef JWT_H
++#define JWT_H
++
++#define JWT_ALG "alg"
++
++/* Use 512bit HMAC */
++#define JWT_ALG_VALUE "HS512"
++
++#define JWT_TYP "typ"
++
++#define JWT_TYP_VALUE "jwt"
++
++#define SERVER_ADDRESS "https://api.reclaim"
++
++/**
++ * Create a JWT from attributes
++ *
++ * @param aud_key the public of the audience
++ * @param sub_key the public key of the subject
++ * @param attrs the attribute list
++ * @param expiration_time the validity of the token
++ * @param secret_key the key used to sign the JWT
++ * @return a new base64-encoded JWT string.
++ */
++char*
++OIDC_id_token_new (const struct GNUNET_CRYPTO_EcdsaPublicKey *aud_key,
++ const struct GNUNET_CRYPTO_EcdsaPublicKey *sub_key,
++ const struct GNUNET_RECLAIM_ATTRIBUTE_ClaimList *attrs,
++ const struct GNUNET_TIME_Relative *expiration_time,
++ const char *nonce,
++ const char *secret_key);
++
++/**
++ * Builds an OIDC authorization code including
++ * a reclaim ticket and nonce
++ *
++ * @param issuer the issuer of the ticket, used to sign the ticket and nonce
++ * @param ticket the ticket to include in the code
++ * @param nonce the nonce to include in the code
++ * @return a new authorization code (caller must free)
++ */
++char*
++OIDC_build_authz_code (const struct GNUNET_CRYPTO_EcdsaPrivateKey *issuer,
++ const struct GNUNET_RECLAIM_Ticket *ticket,
++ const char* nonce);
++
++/**
++ * Parse reclaim ticket and nonce from
++ * authorization code.
++ * This also verifies the signature in the code.
++ *
++ * @param audience the expected audience of the code
++ * @param code the string representation of the code
++ * @param ticket where to store the ticket
++ * @param nonce where to store the nonce
++ * @return GNUNET_OK if successful, else GNUNET_SYSERR
++ */
++int
++OIDC_parse_authz_code (const struct GNUNET_CRYPTO_EcdsaPublicKey *audience,
++ const char* code,
++ struct GNUNET_RECLAIM_Ticket **ticket,
++ char **nonce);
++
++/**
++ * Build a token response for a token request
++ * TODO: Maybe we should add the scope here?
++ *
++ * @param access_token the access token to include
++ * @param id_token the id_token to include
++ * @param expiration_time the expiration time of the token(s)
++ * @param token_response where to store the response
++ */
++void
++OIDC_build_token_response (const char *access_token,
++ const char *id_token,
++ const struct GNUNET_TIME_Relative *expiration_time,
++ char **token_response);
++/**
++ * Generate a new access token
++ */
++char*
++OIDC_access_token_new ();
++
++
++#endif
+--- /dev/null
++++ b/src/rest-plugins/json_reclaim.h
+@@ -0,0 +1,48 @@
++/*
++ This file is part of GNUnet.
++ Copyright (C) 2009-2018 GNUnet e.V.
++
++ GNUnet is free software: you can redistribute it and/or modify it
++ under the terms of the GNU Affero General Public License as published
++ by the Free Software Foundation, either version 3 of the License,
++ or (at your option) any later version.
++
++ GNUnet is distributed in the hope that it will be useful, but
++ WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
++ Affero General Public License for more details.
++
++ You should have received a copy of the GNU Affero General Public License
++ along with this program. If not, see <http://www.gnu.org/licenses/>.
++
++ SPDX-License-Identifier: AGPL3.0-or-later
++*/
++
++/**
++ * @file rest-plugins/json_reclaim.h
++ * @brief JSON handling of reclaim data
++ * @author Martin Schanzenbach
++ */
++#include "platform.h"
++#include "gnunet_util_lib.h"
++#include "gnunet_json_lib.h"
++#include "gnunet_reclaim_service.h"
++#include "gnunet_reclaim_attribute_lib.h"
++
++/**
++ * JSON Specification for Reclaim claims.
++ *
++ * @param ticket struct of GNUNET_RECLAIM_ATTRIBUTE_Claim to fill
++ * @return JSON Specification
++ */
++struct GNUNET_JSON_Specification
++GNUNET_RECLAIM_JSON_spec_claim (struct GNUNET_RECLAIM_ATTRIBUTE_Claim **attr);
++
++/**
++ * JSON Specification for Reclaim tickets.
++ *
++ * @param ticket struct of GNUNET_RECLAIM_Ticket to fill
++ * @return JSON Specification
++ */
++struct GNUNET_JSON_Specification
++GNUNET_RECLAIM_JSON_spec_ticket (struct GNUNET_RECLAIM_Ticket **ticket);